﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LJ.DataAccess.Abstractions;

/// <summary>
/// 事务提供器
/// </summary>
public interface ITransactionalProvider:IDisposable
{
    bool IsCommit { get; }
    bool IsRolledback { get;  } 

    Task BeginAsync(CancellationToken cancellationToken = default);
    Task CommitAsync(CancellationToken cancellationToken = default);
    Task RollbackAsync(CancellationToken cancellationToken = default);

    void Begin();
    void Commit();
    void Rollback();
}
